/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.haiberg.osgi.bundle.reportcaller.activator;

import com.haiberg.osgi.bundle.reportcaller.tracker.HttpServiceTracker;
import com.haiberg.osgi.bundle.reportcaller.tracker.ReportFileServiceTracker;
import com.haiberg.osgi.bundle.reportcaller.tracker.ReportServiceTracker;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

/**
 *
 * @author gyue
 */
public class Activator implements BundleActivator{

    HttpServiceTracker httpServiceTracker;
    ReportServiceTracker reportServiceTracker;
    ReportFileServiceTracker reportFileServiceTracker;
    @Override
    public void start(BundleContext bc) throws Exception {
        httpServiceTracker = new HttpServiceTracker(bc);
        httpServiceTracker.open();
        
        reportServiceTracker = new ReportServiceTracker(bc);
        reportServiceTracker.open();
        
        reportFileServiceTracker = new ReportFileServiceTracker(bc);
        reportFileServiceTracker.open();
    }

    @Override
    public void stop(BundleContext bc) throws Exception {
        httpServiceTracker.close();
        httpServiceTracker = null;
        
        reportServiceTracker.close();
        reportServiceTracker = null;
        
        reportFileServiceTracker.close();
        reportFileServiceTracker = null;
    }
    
}
